package com.ck.dp.FilterPattern.person.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.ck.dp.FilterPattern.person.domain.Person;
import com.ck.dp.FilterPattern.person.service.Criteria;

public class CriteriaMale implements Criteria{
	
	/*
	 * 过滤 为所有男生的一个集合
	 * @see com.ck.dp.FilterPattern.person.service.Criteria#meetCriteria(java.util.List)
	 */
	public List<Person> meetCriteria(List<Person> persons) {
		List<Person> malePersons = new ArrayList<Person>();
		
		for (Person person : persons) {
			if (person.getGender().equalsIgnoreCase("MALE")) {
				malePersons.add(person);
			}
		}
		return malePersons;
	}

}
